1. Field of the Invention
This invention relates generally to computer peripheral devices, and more particularly to devices for processing data to detect synchronization patterns from compact disc media.
2. Description of the Related Art
Originally, compact disc read-only memory (CD-ROM) technology gained popularity as an audio technology. By providing superior digital sound quality, CD-ROM drives and discs have effectively displaced phonographs in the music industry. In recent years, CD-ROM technology has also become popular in computer industry as well for recording and reading a large amount of information or data.
Indeed, the CD-ROM drive has been adopted by the computer industry as a standard peripheral device. Prior Art FIG. 1A illustrates a computer system 100 including an external CD-ROM drive 104. The computer system 100 is coupled to the external CD-ROM drive 104 through a cable 106 conforming to standards such as IDE, SCSI, ATAPI, etc. By loading CD-ROM discs into the CD-ROM drive, a user of the computer system can conveniently access volumes of information for education, entertainment, games, music, etc.
Prior Art FIG. 1B illustrates a functional block diagram of a conventional CD-ROM drive peripheral device. An analog interface 110 receives a data stream from a CD-ROM medium (e.g., disc) for interfacing data to a digital signal processor (DSP) 112. The DSP 112 processes and transmits the data stream in serial mode to a CD-ROM decoder 116. An eight-to-fourteen modulation (EFM) decoder 114 also transmits data to the CD-ROM decoder 116.
The CD-ROM decoder 116 includes a synchronization (sync) detector and a header detector. Accordingly, the sync detector evaluates the data stream to detect sync patterns or marks as they are received. The header detector detects headers to determine whether the header contains a desired header that is associated with a desired sector minute-second-frame (MSF) address. In addition, the CD-ROM decoder 116 performs other decoding functions such as error correction code (ECC). Then, only the data from the CD-ROM decoder 116 goes into a host 100 (e.g., computer system) through an interface such as IDE or SCSI interface.
In CD-ROM media (e.g., CD-ROM disc), information or data is typically stored in units of sectors that are laid out in a continuous spiral from the center and extending through to the circumference of the CD-ROM disc. Prior Art FIG. 1C shows the sequential arrangement of exemplary sectors 11, 12, 13, 14, and 15 in a CD-ROM disc. Each sector contains 2,352 bytes including a synchronization (sync) word 122 of twelve bytes. Hence, two consecutive sync words 122 are separated by 2,340 bytes. The twelve bytes in the sync word 122 are generally assigned a sync pattern that include two 0""s at the beginning and two 0""s at the end of the twelve byte word, with all the remaining bits in between filled with 1""s.
In order to access specific information in CD-ROM media, the CD-ROM drive must be able to identify the beginning of a sector. By providing a sync pattern that is exceptional to the rest of the data pattern, the CD-ROM drive can readily recognize the beginning of a sector. Immediately following the sync pattern is a header of four bytes. The header provides the MSF address of the sector. Following the four byte header are 2,048 bytes for storage of data and 288 bytes of auxiliary data for storing error detection code (EDC) and error correction code (ECC). It should be appreciated that the data can be audio data, in which case, the sector does not contain a header or auxiliary data.
Once the beginning of the sector has been identified, the CD-ROM drive can read the header following the sync pattern to determine whether the current sector is the desired sector. If the MSF address in the header of the current sector matches that of the desired sector, then the sector contains the desired data. Otherwise, the CD-ROM drive proceeds to identify the next sync word.
Reading from CD-ROM media typically involves the host issuing a command specifying the address of sectors to be read. In response, the CD-ROM drive obtains the track number where the sectors can be found from a Table of Contents on the CD-ROM media. Each track has a few thousand sectors. The CD-ROM drive reads data from the beginning of the track, searching specifically for sync patterns to identify the sectors. In this process, whenever a sync mark is detected, the associated header information indicating the MSF address of the sector is retrieved. If the address of the sector matches that of the desired sector, then the target sector has been found and desired data can be read. When the last desired sector has been read, the sync detection and reading processes terminate.
Detecting sync marks, however, has presented several problems in the past. For example, a sync pattern often cannot be detected as a sync mark due to noise, which may cause a 0 in the sync pattern to be read as 1 or vice versa. In addition, physical elements such as fingerprints, dust, etc. can cause an obstruction on CD-ROM media, which may lead to degradation or mis-reading of a sync pattern. When the sync mark associated with a sector cannot be detected in these situations, the reading head of a CD-ROM drive will move back to the beginning of the track again. In the alternative, when one or two sync marks are not detected in the middle of a sequence of several sectors, a sync mark is inserted based on the detected sync marks of other sectors.
Another problem in detecting sync marks involves so called xe2x80x9cpacket writingxe2x80x9d in CD-Recordable (CD-R) media or discs, which is usually written only one time, in one or more sessions, and then can be read like typical CD-ROM discs. Specifically, information in packet writing is recorded in a sequence of sectors while the CD-R disc is rotating. This rotation generates an inherent gap in time between detecting the beginning of a sector and writing on the sector. That is, when the beginning of a sector is detected, the desired writing location on the CD-R disc will usually be passed-up, and therefore the writing location will be late by a number of bytes. Hence, when the sync pattern is written to mark the beginning of the sector, the sync mark is inherently recorded after a gap of a number of bytes. When the disc is read back, the sync mark may not be detected at all because the sync pattern is not at the proper place (i.e., at every 2353 bytes). In addition, the gap created in packet writing wastes disc space.
In the prior art, when a desired sync mark is not detected, the CD-ROM peripheral device typically restarts the search again by repositioning its read head in the original track position. The CD-ROM device then waits for the disc to rotate to the beginning of the track, and then restarts the reading to detect sync marks. Waiting for the entire revolution of the disc thus increases latency and degrades performance.
In view of the foregoing, what is needed is a device and method that can reliably detect sync patterns. What is further needed is a device and method that differentiates a genuine sync pattern from an erroneous one. In addition, what is needed is a device and method that can also detect missing sync pattern with a high degree of reliability.
Broadly speaking, the present invention fills these needs by providing a device and method for reliably detecting synchronization patterns in CD-ROM media. It should be appreciated that the present invention can be implemented in numerous ways, including as a process, an apparatus, a system, a device, a method, or a computer readable medium. Several inventive embodiments of the present invention are described below.
In one embodiment, a peripheral device having internal circuitry for controlling and processing data that is read from a medium of the peripheral device is disclosed. The peripheral device comprises a digital signal processor, a decoder circuit, and a state machine. The digital signal processor is configured to receive the data that is being read from the medium of the peripheral device. The decoder circuit is coupled to the digital signal processor and forms a part of the internal circuitry. Further, the decoder circuit includes an internal RAM that is configured to store a sector of the data including a current sync pattern and a next sync pattern. The state machine resides in the decoder for analyzing the current sync pattern and the next sync pattern of the sector of the data. In the analysis mode, the state code is configured to determine whether a fatal error is present in the data.
In another embodiment, a method for detecting sync patterns from data that is read from a CD-ROM medium is disclosed. The method includes: a) receiving the data that is being read from the CD-ROM medium; b) storing a sector of the data including a current sync pattern and a next sync pattern; and c) analyzing the current sync pattern and the next sync pattern of the sector of the data to determine whether a fatal error is present in the data. Preferably, the fatal error is present when the current sync pattern and the next sync pattern are not identified and the analyzing determines that a middle sync pattern between the current sync pattern and the next sync pattern is not identified.
In yet another embodiment, a device includes a means for sequentially receiving data that are read from the CD-ROM media for processing. The device further includes a means for storing the sequentially received data in a first-in-first-out (FIFO) buffer. Preferably, the FIFO buffer is large enough to store a current sync pattern, a sector associated with the current sync pattern, and a next sync pattern. In this configuration, the data is stored in the FIFO buffer as received in a first-in and first-out manner such that the next sync pattern becomes a new current sync pattern and a new next sync pattern becomes a new next sync pattern. In addition, the device includes a means for detecting the integrity of the sync patterns in the data stored in the FIFO buffer wherein a fatal error is triggered when no sync pattern is identified in the FIFO buffer.
Advantageously, the present invention can detect an unidentified sync pattern and continue with normal operation without restarting the search from the beginning of a track. For example, the present invention allows detection of the unidentified sync pattern by identifying the presence of the next sync pattern when a sync pattern is not identified due to corruption or noise. The detection of the next sync pattern thus confirms that the previous unidentified sync pattern has been misread due to corruption, noise, etc.